﻿@model Model.Contacts

<form id="form_add_contact" action="/Contact/add"  method="post">
    @if (Model != null)
    {
        <input type="hidden" name="Id" value="@Model.Id " />

    }
    <div class="form-group">
        <label for="txtusername">用户名：</label>
        <input type="text" class="form-control" id="txtusername" name="UserName" placeholder="Email" value="@(Model==null?"":Model.UserName) ">
    </div>
    <div class="form-group">
        <label for="exampleInputPassword1">手机</label>
        <input type="text" class="form-control" id="txttel" name="Tel" placeholder="Email" value="@(Model==null?"":Model.Tel) ">
    </div>
    <div class="form-group">
        <label for="exampleInputFile"> 固话：</label>
        <input type="text" class="form-control" id="txttel1" name="Tel1" placeholder="Email" value="@(Model==null?"":Model.Tel1) ">

    </div>
    <div class="form-group">
        <label for="exampleInputFile"> 地址：</label>
        <input type="text" class="form-control" id="txttel1" name="Address" placeholder="Email"  value="@(Model==null?"":Model.Address)">

    </div>
    <div class="form-group">
        <label for="exampleInputFile"> 价格：</label>
        <input type="text" class="form-control" id="txttel1" name="Price" placeholder="Email" value="@(Model==null?"":Model.Price.ToString())">

    </div>

    <button type="submit" class="btn btn-default">Submit</button>
</form>
<script src="~/Scripts/jquery-1.10.2.js"></script>
<script src="~/Scripts/jquery.form.js"></script>
<script>
    $("#form_add_contact").ajaxForm(function (data) {
        if (data.success) {
            console.log("ok");
            console.log(data.contact);
        } else {
            console.log("error");
        }

    });
</script>

